package com.cms.work.shiro;

import org.apache.shiro.authz.Permission;
import org.apache.shiro.authz.permission.PermissionResolver;
import org.apache.shiro.authz.permission.WildcardPermission;

/**
 * <p>Title: UrlPermissionResovler</p>
 * <p>Description: 过滤Url串</p>
 * <p>Email: yuyue_qty@163.com</p>
 * @author 晴天雨
 * @date 2016年2月2日下午5:15:39
 * @version 1.0
 */
public class UrlPermissionResovler implements PermissionResolver {

	@Override
	public Permission resolvePermission(String permissionString) {
		if(permissionString.startsWith("/")){
			return new UrlPermission(permissionString);
		}
		return new WildcardPermission(permissionString);
	}

}
